class Animal {
    String name;
    int age;
    public Animal(String name,int age){
        this.name = name;
        this.age = age;
    }
    public void eat() {
        System.out.println("动物正在吃食物");
    }
}
class Dog extends Animal{
    public Dog(String name,int age) {
        super(name,age);
    }
    public void eat() {
        System.out.println(this.name + "正在吃狗粮~~~");
    }
}
class Cat extends Animal{
    public Cat(String name,int age) {
        super(name,age);
    }
    public void eat() {
        System.out.println(this.name + "正在吃猫粮~~~");
    }
}

public class Test_2 {
    public static void main(String[] args) {
        Cat cat = new Cat("布偶",2);
        Dog dog = new Dog("哈士奇",3);
        cat.eat();
        dog.eat();
    }
}
